package com.jiao.enums;

public enum ExceptionCodeEnum {
    //失败
    ERROR(-1, "网络错误"),
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    LOGIN_ERROR(402,"登录认证失败"),
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_NOEXIST(501,"用户不存在"),
    USERNAME_ERROR(503,"用户密码错误"),
    PHONENUMBER_EXIST(502,"手机号已存在"), EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    //注册
    USERNAME_EXIST(505,"用户名已存在"),

    //注册
    IMG_TYPE_ERROR(506,"上传图片格式不正确"),
    UPDATE_USERINFO_ERROR(507,"更新用户数据失败");
    int code;
    String msg;

    ExceptionCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
